package com.dream.technology.engin.expression;

import java.util.*;

/**
 * 描述：
 *
 * @author chen_q_i@163.com
 * 2019/1/4 : 17:13.
 * @version : 1.0
 */
public class MapUpdate {

    public static void main(String[] args) {

        List<Integer> arr = new ArrayList<>(Arrays.asList(3,4,1,2,3,4,2));
        Map<Integer ,List<Integer>> ruleItemsMap = new HashMap<>();
        arr.forEach(ruleItem -> {
            List<Integer> integers = ruleItemsMap.get(ruleItem);
            if (integers==null){
                integers = new ArrayList<>();
            }
            integers.add(ruleItem);
        });

        ruleItemsMap.forEach((k,v)-> System.out.println(k+"--"+v));




    }


}
